<template>
  <el-container class="allbody" onscroll="false">
    <el-main style="height: 100%; z-index: 5">
      <!--<Calendar-->
      <!--v-on:choseDay="clickDay"-->
      <!--v-on:changeMonth="changeDate"-->
      <!--&gt;</Calendar>-->
      <!-- <el-row style="width: 100%; height: 5%">
        <breadcrumb :naviItems.sync="naviItems"></breadcrumb>
      </el-row> -->
      <el-row style="margin-top: 0%; height: 100%; width: 100%">
        <el-container style="height: 33%; width: 100%">
          <el-aside
            style="
              height: 100%;
              width: 25%;
              border: 1px solid #3b7cbd;
              background-color: rgba(0, 0, 0, 0);
            "
          >
            <BarChart1></BarChart1>
          </el-aside>
          <el-aside
            style="
              height: 100%;
              width: 25%;
              border: 1px solid #3b7cbd;
              background-color: rgba(0, 0, 0, 0);
            "
          >
            <BarChart2></BarChart2>
          </el-aside>
          <el-aside
            style="
              height: 100%;
              width: 25%;
              border: 1px solid #3b7cbd;
              background-color: rgba(0, 0, 0, 0);
            "
          >
            <BarChart3></BarChart3>
          </el-aside>

          <el-aside
            style="
              height: 100%;
              width: 25%;
              border: 1px solid #3b7cbd;
              background-color: rgba(0, 0, 0, 0);
            "
          >
            <BarChart4></BarChart4>
          </el-aside>
        </el-container>

        <el-container style="height: 33%; width: 100%">
          <el-aside
            style="
              height: 100%;
              width: 25%;
              border: 1px solid #3b7cbd;
              background-color: rgba(0, 0, 0, 0);
            "
          >
            <BarChart5></BarChart5>
          </el-aside>
          <el-aside
            style="
              height: 100%;
              width: 25%;
              border: 1px solid #3b7cbd;
              background-color: rgba(0, 0, 0, 0);
            "
          >
            <BarChart6></BarChart6>
          </el-aside>
          <el-aside
            style="
              height: 100%;
              width: 25%;
              border: 1px solid #3b7cbd;
              background-color: rgba(0, 0, 0, 0);
            "
          >
            <BarChart7></BarChart7>
          </el-aside>

          <el-aside
            style="
              height: 100%;
              width: 25%;
              border: 1px solid #3b7cbd;
              background-color: rgba(0, 0, 0, 0);
            "
          >
            <BarChart8></BarChart8>
          </el-aside>
        </el-container>

        <el-container style="height: 33%; width: 100%">
          <el-aside
            style="
              height: 100%;
              width: 25%;
              border: 1px solid #3b7cbd;
              background-color: rgba(0, 0, 0, 0);
            "
          >
            <BarChart9></BarChart9>
          </el-aside>
          <el-aside
            style="
              height: 100%;
              width: 25%;
              border: 1px solid #3b7cbd;
              background-color: rgba(0, 0, 0, 0);
            "
          >
            <BarChart10></BarChart10>
          </el-aside>
          <el-aside
            style="
              height: 100%;
              width: 25%;
              border: 1px solid #3b7cbd;
              background-color: rgba(0, 0, 0, 0);
            "
          >
            <BarChart11></BarChart11>
          </el-aside>

          <el-aside
            style="
              height: 100%;
              width: 25%;
              border: 1px solid #3b7cbd;
              background-color: rgba(0, 0, 0, 0);
            "
          >
            <div
              style="
                color: #3b7cbd;
                font-size: 50px;
                margin-top: 90px;
                text-align: center;
              "
            >
              结构健康监测
            </div>
            <div
              style="
                color: #3b7cbd;
                font-size: 50px;
                margin-top: 2px;
                text-align: center;
              "
            >
              应力幅值直方图
            </div>
          </el-aside>
        </el-container>
      </el-row>
    </el-main>
  </el-container>
</template>

<script>
import ElContainer from "element-ui/packages/container/src/main";
import ElAside from "element-ui/packages/aside/src/main";
import ElHeader from "element-ui/packages/header/src/main";
import ElMain from "element-ui/packages/main/src/main";
import Breadcrumb from "../../../../components/QipingBreadCrumb/BreadCrumb.vue";
import { get, get as userType, del, dels } from "@/api/sys/connSysAuthApi";
import { parseTime } from "@/utils";
import { req } from "@/api/base/BaseApi";

import Calendar from "vue-calendar-component";
import BarChart1 from "./components/barChar1";
import BarChart2 from "./components/barChar2";
import BarChart3 from "./components/barChar3";
import BarChart4 from "./components/barChar4";
import BarChart5 from "./components/barChar5";
import BarChart6 from "./components/barChar6";
import BarChart7 from "./components/barChar7";
import BarChart8 from "./components/barChar8";
import BarChart9 from "./components/barChar9";
import BarChart10 from "./components/barChar10";
import BarChart11 from "./components/barChar11";
const defaultForm = {
  id: undefined,
  commissionDate: undefined,
  position: undefined,
  repairContent: undefined,
  number: undefined,
  projectType: undefined,
  finishDate: undefined,
  workUnit: undefined,
  workTime: undefined,
};
export default {
  name: "index",
  components: {
    Calendar,
    BarChart1,
    BarChart2,
    BarChart3,
    BarChart4,
    BarChart5,
    BarChart6,
    BarChart7,
    BarChart8,
    BarChart9,
    BarChart10,
    BarChart11,
    Breadcrumb
  },
  comments: {
    ElMain,
    ElHeader,
    ElAside,
    ElContainer,
  },
  methods: {
    dateFormat(time) {
      var date = new Date(time);
      var year = date.getFullYear();
      /* 在日期格式中，月份是从0开始的，因此要加0
       * 使用三元表达式在小于10的前面加0，以达到格式统一  如 09:11:05
       * */
      var month =
        date.getMonth() + 1 < 10
          ? "0" + (date.getMonth() + 1)
          : date.getMonth() + 1;
      var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
      var hours =
        date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
      var minutes =
        date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
      var seconds =
        date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
      // 拼接
      return (
        year +
        "-" +
        month +
        "-" +
        day +
        " " +
        hours +
        ":" +
        minutes +
        ":" +
        seconds
      );
    },
    tableRowStyle({ row, rowIndex }) {
      return "background-color: #02152f;color: #fff";
    },
    tableHeaderColor({ row, column, rowIndex, columnIndex }) {
      if (rowIndex === 0) {
        return "background-color: #2ec7c9;color: #fff;font-weight: 500;";
      }
    },
    handleSetLineChartData(type) {
      this.lineChartData = lineChartData[type];
    },
    getRowClass({ row, column, rowIndex, columnIndex }) {
      return "background-color: rgba(34,34,34,0.3);color:#72C22D;";
    },
    show() {
      req("/lifting-service/mgrepair/allList", "GET", "")
        .then((response) => {
          this.tableData = response.data;
          console.log(this.tableData);
          let i = 0;
          for (i; i < this.tableData.length; i++) {
            this.tableData[i].commission_date = this.tableData[
              i
            ].commission_date.substr(0, 10);
            this.tableData[i].finish_date = this.tableData[
              i
            ].finish_date.substr(0, 10);
          }
        })
        .catch(() => console.log("page request error"));
    },
    yearChange(id, type) {
      this.year = id;
    },
    monthChange(id, type) {
      this.month = id;
    },
    dayChange(id, type) {
      this.day = id;
    },
  },
  created() {
    // req('/api/sys/auth/MG/pointIndexList', 'POST', '').then(response => {
    //   var i = 0
    //   for (i; i < 56; i++) {
    //     this.tableData[i].one = response.data[i].id
    //     this.tableData[i].two = response.data[i].part
    //     this.tableData[i].three = response.data[i].partcontent
    //   }
    // }).catch(() => console.log('page request error'))
  },
  data() {
    return {
      date: new Date(),
      calendar: {},
      tableData: [],
      postForm: Object.assign({}, defaultForm),
      naviItems: [{ text: "起重机械" }, { text: "数据引擎" },{text:'模型预测'}],
    };
  },
  filters: {
    userTypeFilter(type) {
      let typeText = type;
      userTypes.forEach((val) => {
        if (type === val.value) {
          typeText = val.name;
        }
      });
      return typeText;
    },
    menuFilter(ids) {
      let length = 0;
      if (ids) {
        length = ids.length;
      }
      return length;
    },
    dateTimeFilter(time) {
      return parseTime(time);
    },
  },
  mounted: function () {
    let _this = this; //声明一个变量指向vue实例this,保证作用域一致
    (this.timer = setInterval(function () {
      _this.date = new Date(); //修改数据date
    }, 1000)),
      console.log(this.$route.path); // 输出当前页面的路由，如：/home

    this.show();
    this.postForm = Object.assign({}, defaultForm);
  },
};
</script>

<style lang="less" scoped>
.headerbackgroud {
  // background-image: url("../../../../assets/screen-header.jpg");
}
.allbody {
  width: 100%;
  height: 1050px;
  // background-image: url("../../../../assets/bg.jpg");
}
.rowclass {
  width: 100%;
  height: 50%;
}

#text {
  -webkit-text-fill-color: white;
}
.select {
  color: white;
}
.hello {
  // 未选中任何选项的时候 placeholder的样式 需要先选中父元素 增加
  /deep/ input::-webkit-input-placeholder {
    color: #fff;
  }
  /deep/ input::-moz-input-placeholder {
    color: #fff;
  }
  /deep/ input::-ms-input-placeholder {
    color: #fff;
  }

  //修改的是el-input的样式
  //一种方法是设置最里层el-input__inner的背景色 外层的两级父元素设置为透明色
  //另一种方法是从el-select到el-input__inenr的背景色都设置为需要的颜色
  /deep/ .el-select,
  /deep/ .el-input,
  /deep/ .el-input__inner {
    background-color: #08164d;
    color: #fff;
    border: 0px;
    border-radius: 0px;
    text-align: center;
  }
}
.map1,
.map2,
.map3 {
  position: absolute;
  opacity: 0.5;
}
.map1 {
  margin-left: 580px;
  margin-top: 230px;
  z-index: 2;
  animation: myfirst2 15s infinite linear;
}
.map2 {
  margin-left: 625px;
  margin-top: 275px;
  z-index: 3;
  opacity: 0.2;
  animation: myfirst 10s infinite linear;
}
.map3 {
  margin-left: 650px;
  margin-top: 300px;
  z-index: 1;
}
@keyframes myfirst2 {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(359deg);
  }
}

@keyframes myfirst {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(-359deg);
  }
}
</style>
